package com.qf.qfleadnewsfeignapi.wemedia;

import com.qf.qfleadnewsmodel.wemedia.pojos.WmNews;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * 远程访问Wemedia的feign接口
 */
@FeignClient(value = "qf-wemedia")
public interface WmNewsApi {

    /**
     * 根据newsid 查询对应wmnews对象
     * @param id
     * @return
     */
    @GetMapping("/api/wmnews/one/{id}")
    public WmNews findById(@PathVariable("id") Integer id);

    @GetMapping("/api/wmuser/name/{id}")
    public String findAuthorNameByAuthorId(@PathVariable("id") Integer id);

    @GetMapping("/api/wmchannel/name/{id}")
    public String findChannelNameByChannelId(@PathVariable("id") Integer id);

    @GetMapping("/api/wmnews/fill/{newsId}/{articleId}")
    public void fillArticleId(@PathVariable("newsId") String newsId,@PathVariable("articleId") String articleId);
}
